//
//  HEMoreView.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/10/13.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEMoreView.h"

@interface HEMoreView()

@property (nonatomic, strong) UILabel *manTitleLb;

@end

@implementation HEMoreView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self initUI];
    }
    return self;
}

- (void)initUI {
    
    _manTitleLb = [UILabel new];
    _manTitleLb.font = DYBlodFont(20);
    [self addSubview:_manTitleLb];
    
    UILabel *allLb = [UILabel new];
    allLb.text = @"全部";
    allLb.font = DYFont(14);
    allLb.textColor = [UIColor colorWithHexString:@"#AAAAAA"];
    allLb.textAlignment = NSTextAlignmentRight;
    [self addSubview:allLb];
      
    UIImageView *leftIcon = [[UIImageView alloc] initWithImage:IMAGE_NAMED(@"home_more")];
    [self addSubview:leftIcon];
      
    [_manTitleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).mas_offset(0);
        make.left.equalTo(self).mas_offset(0);
        make.right.equalTo(self).mas_offset(-0);
        make.bottom.equalTo(self).mas_offset(-0);
    }];
    
    [leftIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(_manTitleLb).mas_offset(0);
        make.right.equalTo(self).mas_offset(-0);
        make.width.mas_offset(6.1);
        make.height.mas_offset(10.7);
    }];
     
    [allLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(_manTitleLb).mas_offset(0);
        make.right.equalTo(leftIcon.mas_left).mas_offset(-5);
    }];
}

- (void)setTitle:(NSString *)title {
    _title = title;
    _manTitleLb.text = title;
}

@end
